﻿using Corina.DataContext.Master;
using Corina.Datamodel.DataObject;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace Corina.Webservice.Cydee
{
    /// <summary>
    /// Summary description for Documents
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class Documents : WebserviceBase
    {

        [WebMethod]
        public ResultInfo GetAllGuobiaoDocumentItems(string account, string password, string key, int index, int size)
        {
            return GetInstance<NationalStandardMaster>().GetAllItems(account, password, key, index, size);
        }

        [WebMethod]
        public ResultInfo GetNationalStandardInfo(string account, string password, string code)
        {
            return GetInstance<NationalStandardMaster>().GetNationalStandardInfo(account, password, code);
        }

        [WebMethod]
        public ResultInfo SaveGuobiaoInfo(string account, string password, string filename, string code, string name, string description)
        {
            return GetInstance<NationalStandardMaster>().Insert(account, password, new Datamodel.Entities.NationalStandardInfo() { Code = code, DocumentName = filename, Name = name, Description = description });
        }
    }
}
